public class test30 {
    //判断101~200之间有多少个质数,并列出所有质数.
    public static void main(String[] args) {
        int count = 0;
        for (int j = 101; j < 201; j++) {
            boolean flag = true;
            for (int i = 2; i < 101; i++) {
                if (j % i == 0) {
                   flag = false;
                   break;
                }
            }
            if (flag) {
                System.out.println(j + "为质数");
                count++;
            }
        }
        System.out.println("共有" + count + "个质数");
    }
}